<?php if ($this->pageCount > 1): ?>
<ul class="paginator">
    <?php if (isset($this->previous)): ?>
        <?php if ($this->first != $this->previous): ?>
            <li class="first"><a href="?page=<?php echo $this->first; ?>">&laquo;</a></li>
        <?php endif; ?>
        <li class="previous"><a href="?page=<?php echo $this->previous; ?>">&lsaquo;</a></li>
    <?php endif; ?>
    <?php foreach ($this->pagesInRange as $page): ?>
        <li  class="<?php echo ($page == $this->current) ? 'current' : 'item'; ?>"><a href="?page=<?php echo $page; ?>"><?php echo $page; ?></a></li>
    <?php endforeach; ?>
    <?php if (isset($this->next)): ?>
        <li class="next"><a href="?page=<?php echo $this->next; ?>">&rsaquo;</a></li>
        <?php if ($this->next != $this->last): ?>
            <li class="last"><a href="?page=<?php echo $this->last; ?>">&raquo;</a></li>
        <?php endif; ?>
    <?php endif; ?>
</ul>
<?php endif; ?>